<template>
  <div>
    <iframe
      id="iframe_id"
      :src="src"
      frameborder="0"
      style="
        width: calc(98vh*(9/17));
        height: 98vh;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%,-50%);
        "
      scrolling="no"
    />
  </div>
</template>

<script>
import { param2Obj } from '@/utils'
export default {
  data() {
    return {
      src: ''
    }
  },
  created() {
    const { src } = param2Obj(window.location.href)
    if (src) this.src = src.indexOf('?') > -1 ? `${src}&iframe=true` : `${src}?iframe=true`
    else this.src = `http://localhost:8080/#/`
  }
}
</script>

<style lang="less" scoped>
/* 针对IE和Edge */
iframe {
  -ms-overflow-style: none;  /* IE 10+ */
}

/* 针对Firefox */
iframe {
  scrollbar-width: none;  /* Firefox 64 */
}

/* 针对Chrome, Safari 和 Opera */
iframe::-webkit-scrollbar {
  display: none;
}
</style>
